home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 13
/
013.d81
/
directory editor
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
8KB
|
279 lines
1 a$="":iffl=0thengosub60000
3 goto50:rem"[141][147] software by bull[141]
7 [128]:[143]"
10 : directory editor
11 :
15 : by
19 : dick bull 738 pueblo ave
23 : napa, ca. 94558
27 :
32 rem"[141] 'list 50 -' to see program[141]"(NULL)
50 iffl=0thenfl=1:load"input 30.o",8,1
52 a$="":poke53281,1:print"[147][144]";chr$(14)
55 print" [196]irectory edit[146]"
60 print" [212]his program will do the following:
65 [153]" 1:wait (NULL)(NULL)(NULL)valclosedirectory listings
70 print" 2:[146] [205]ake a place in the directory"
75 print" where ever you want, so that the next";
80 print" saved file will appear there"
85 print" 3:[146] [205]ake a mark (------------)"
90 print" [each will be different -- 45 max]
95 [153]" any place in the directory"
100 [153]" 4:wait (NULL)len(NULL)atn(NULL)lenleft$ and (NULL)val(NULL)atn(NULL)val files
105 print" [rename that mystery file]
110 [153]" [scratch '' or',' etc.]
115 print" 5:[146] [204][207][195][203]/ [213][206][204][207][195][203] files;
120 [153]" locked files can't be scratched. and are printed reversed
125 print" selected locked files will be unlocked. ";
130 print"selected unlocked files will be locked
135 :
140 [134]b(18),f$(144):[151]198,0
145 z$[178]""
150 b(1)[178]1:b(2)[178]4:b(3)[178]7:b(4)[178]10:b(5)[178]13:b(6)[178]16:b(7)[178]2:b(8)[178]5:b(9)[178]8:b(10)[178]11
155 b(11)[178]14:b(12)[178]17:b(13)[178]3:b(14)[178]6:b(15)[178]9:b(16)[178]12:b(17)[178]15:b(18)[178]18
160 [153]," press a key":[141]1245
165 [153]"load(NULL)hen you are finished it will rewrite the directory on the disk.
170 print"[214]alidate[146] the disk if desired. [196]o not useon disks with random files
175 [153]"(NULL)oft-write protectwait the disk if selected will act like the write ";
180 [153]"protect tab on adisk. right$t works by giving a dos mismatch
185 print"error on attempting to write to the disk
190 [153]"peekoth hard and soft write protected disks";
195 [153]"will be checked for at the start of the program and removed if desired.
200 print"[208]lace the disk to edit in the drive and "
202 print" press a key."
205 gosub1245
210 printchr$(142)"[147]";
215 open1,8,15:print#1,"i"
220 open2,8,2,"#":gosub790
225 open3,8,3,"0:tz,u,w":gosub790
230 ifer<>0thenclose2:close3:close1:goto210
235 close3:print#1,"s0:tz"
240 n=1:z=1:t=18:s=1:hi$="":k=1
245 fori=1to11:hi$=hi$+chr$(0):next
250 k$=chr$(131)+chr$(18)+chr$(0):da$="----------------"+hi$:fi$=" "
255 print"reading files. please wait
260 [152]1,"u1 2 0";t;s
265 [161]#2,t$,s$
270 t[178][198](t$[170][199](0)):s[178][198](s$[170][199](0))
275 [139]t[177]0[167]z[178]z[170]1
280 bp[178]2
285 [129]i[178]1[164]8:[153]""z;i
290 [152]1,"b-p 2";bp
295 [158]828,2:[139]bp[179]226[167]bp[178]bp[170]32
300 [139][198]([200](a$,1))[179][177]0[167]f$(n)[178]a$:n[178]n[170]1:[130]
305 [139][198]([200](a$,1))[178]0[167][130]
310 [139]t[179][177]0[167][137]260
315 za[178]z:na[178]n
320 [129]r[178]1[164]n:[139][202](f$(r),4,1)[179][177]"-"[167]332
325 [139][202](f$(r),5,1)[178]"-"[176][202](f$(r),6,1)[178]"-"[167]da[178]da[170]1
332 [130]r
335 :
340 [143] directory listing
345 :
350 [153]"load directory editwait"
355 [129]i[178]k[164]k[170]17
360 [139]i[177]n[171]1[167]380
365 [139][198](f$(i))[175]64[167][153]"";
370 i$[178][196](i):i$[178][201]([196](i),[195](i$)[171]1)[170]" "
375 [153]"stop"i$;:[151]212,128:[153][202](f$(i),4,16):[151]212,0
380 [139]i[170]18[177]n[171]1[167]395
385 [139][198](f$(i[170]18)) [175]64[167][153]"";
390 [153][163]19)"onstop";i[170]18;"stop";:[151]212,128:[153][202](f$(i[170]18),4,16):[151]212,0
395 [130]:[151]212,0
400 [153]z$"f1wait insert space f2wait remove spaces
405 print"f3[146] move entries f4[146] lock/unlock
410 [153]"f5wait add -------wait _wait write or exit
415 print"f7[146] rename file f8[146] delete files
420 [153]"crsr up/downwait page if listing >36 ";
425 [153][199](142);
430 [141]1245
435 [139]a$[178]"_"[167]690
440 [129]t[178]1[164]9:[139][202]("inputgotodimrunreadletrestoreon",t,1)[178]a$[167]450
445 [130]:[137]425
450 [145]t[141]490,665,535,915,605,855,740,455,465 :[137]350
455 k[178]k[171]10:[139]k[178][179]0[167]k[178]1:[143] csr-up
460 [142]
465 [139]k[170]34[179]n[167]k[178]k[170]10:[143] crsr-down
470 [142]
475 :
480 :[143] insert empty file
485 :
490 q$[178]" space above":[141]945
495 [139]a[178][179]0[167][142]
500 [129]i[178]n[164]a[170]1[169][171]1
505 f$(i)[178]f$(i[171]1):[130]:n[178]n[170]1:f$(a)[178]""
510 [129]i[178]1[164]30:f$(a)[178]f$(a)[170][199](0):[130]
515 [142]
520 :
525 :[143] move entries
530 :
535 q$[178]" move":[141]945
540 [139]a[178][179]0[167][142]
545 [139]a[177]n[171]1[167]535
550 b[178]0:[153]z$;:[133]" above which file ";b
555 [139]b[178][179]0[167]585
560 [139]b[177]n[167]550
565 [139]a[178]b[167]585
570 fh$[178]f$(a)
575 [139]a[177]b[167] [129] i[178]a [164] b[170]1 [169][171]1:f$(i)[178]f$(i[171]1):[130]:f$(b)[178]fh$
580 [139]b[177]a[167] [129] i[178]a [164] b[171]1 :f$(i)[178]f$(i[170]1):[130]:f$(b[171]1)[178]fh$
585 [142]
590 :
595 [143] add dashes
600 :
605 q$[178]" dashes above":[141]945
610 [139]a[178][179]0[167][142]
615 [129]i[178]n[164]a[170]1[169][171]1
620 f$(i)[178]f$(i[171]1):[130]:n[178]n[170]1:da[178]da[170]1
625 f$(a)[178]k$[170][200](da$,da)[170]fi$[170][202](da$,da[170]1,15[171]da)[170]hi$:[143] right$ wont work
630 [139]da[177]14[175]fi$[178]" "[167]fi$[178]"=":da[178]0
635 [139]da[177]14[175]fi$[178]"="[167]fi$[178]"+":da[178]0
640 [139]da[177]14[167]da[178]0
645 [142]
650 :
655 :[143] remove empty files
660 :
665 [129]i[178]1[164]n[171]1:[139]([198]([200](f$(i),1)))[178]0[167][137]680
670 [130]
675 [142]
680 [129]r[178]i[164]n[171]1:f$(r)[178]f$(r[170]1):[130]:n[178]n[171]1:[137]665
685 :
690 [153]"load ready to write new directory...
695 print" 1 to return to editing"
700 print" 2 to rewrite directory"
705 print" 0 to end without changing old directory
710 [153]" press key
715 gosub1245:a=val(a$):ifa<0ora>2then715
720 ona+1goto1215,350,965:goto715
725 :
730 rem delete entry
735 :
740 q$=" delete":gosub945
745 ifa=<0thenreturn
750 ifasc(f$(a))and64thenprint"[145] locked file ":gosub1245:goto785
755 print"[147]delete ";mid$(f$(a),4,16)
760 print"are you sure y/n":gosub1245
765 ifa$<>"y"anda$<>"[217]"then785
770 print#1,"s0:"mid$(f$(a),4,16):print"working
775 [141]790:[139]er[177]1 [167] [137]785
780 [129]r[178]a[164]n[171]1:f$(r)[178]f$(r[170]1):[130]:n[178]n[171]1
785 [142]
790 [132]1,er,er$,et,es:[139]er[178]0[167]805
795 [153]""er;er$;et;es:[139]er[178]73 [167]810
800 [153],"press any key to cont":[141]1245
805 [142]
810 [153]"disk is software locked":[133]"do you want to unlock it";a$
815 [139]a$[178]"y"[167] [141]1265:[137]805
820 [139]a$[179][177]"n"[167]810
825 [153]"loadthis program is used to rewrite the directory.
830 print"write protection must be removed for it to work correctly.
835 [153]"check disk and rerun the program"
840 [160]2:[160]1:[128]
845 :
850 [143] [210][197][206][193][205][197]
855 q$[178]" rename":[141]945
860 [139]a[178][179]0[167]895
865 [153]"loadrename ";[202](f$(a),4,16)
870 a$[178]"":[133]"new name";a$:[139]a$[178]""[167]895
875 [139][195](a$)[177]16[167][153]"too long":[137]870
880 a$[178][200](a$[170]"closeclosecloseclosecloseclosecloseclosecloseclosecloseclosecloseclosecloseclose",16)
885 f$(a)[178][200](f$(a),3)[170]a$[170][202](f$(a),20,11)
890 [153][195](f$(a))
895 [142]
900 :
905 [143] lock/unlock
910 :
915 q$[178]" lock/unlock":[141]945
920 [139]a[178][179]0[167]955
925 b[178][198]([200](f$(a),1)):[139]b[175]64[167]b[178]b[175]191:[137]935
930 b[178]b[176]64
935 f$(a)[178][199](b)[170][202](f$(a),2,29)
940 [142]
945 a[178]0:[153]""z$;q$;" which filestop";:[133]a
950 [139]a[177]n[167]945
955 [142]
960 :
965 [153]"on writing new directory
970 print"please do not remove disk until red"
975 print"light is out. thank you
980 [137]985
985 a$[178]""
990 [129]i[178]1[164]30:a$[17